import { Component } from '@angular/core';
import { VisitInfo } from './model/VisitInfo';
import { DatePipe } from '@angular/common';
import { VisitService } from './service/visitService';


@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'br';
  userAgent:any;
  constructor(public datePipe:DatePipe,public visitService:VisitService){}


  ngOnInit(){
    //let visitInfo = new VisitInfo();
    //visitInfo.userAgent = window.navigator.userAgent;
    //visitInfo.timestamp = this.datePipe.transform(new Date(),'yyyy-MM-dd hh:mm:ss');
    //this.visitService.addVisitInfo(visitInfo).subscribe(response=>{
    //});
    this.visitService.VisitOnce().subscribe(res=>{});
  }
}
